package com.hujiheng.paike.utils;

import cn.hutool.core.date.CalendarUtil;

import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

public class DateUtils {
    public static Date setDateTime(Date date, int year, int month, int day) {
        Calendar calendar = CalendarUtil.calendar(date);
        calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
        calendar.set(year, month, day);
        return calendar.getTime();
    }

    public static Date getDateTime(int year, int month, int day) {
        return setDateTime(Calendar.getInstance().getTime(), year, month, day);
    }
}
